import type { CreateBy, SysUser, Region } from '#/entity';
import { PageForm } from '../../interface';
import { FinancialOrderStatus } from '#/enum';

export namespace FinanceOrder {

  export namespace Req {
    // 用户订单列表
    export interface FinanceOrderList extends PageForm {
      subStatus: FinancialOrderStatus
      qxtUserName?: string
      qxtUserPhone?: string
      code?: string,
      module?: string,
      entity?: string,
      status?: string[],
    }
    // 财务审核
    export interface FinanceReview {
      // 审核状态
      subStatus: 'reject' | 'pass',
      // 实付金额
      realMoney?: number,
      // 说明
      remark: string,
      // 凭证
      source?: [
        {
          key: string,
          sources: string[]
        }
      ]
    }



  }

  export namespace Res {
    // 用户订单列表
    export interface FinanceOrder {
      id: string
      sysUser: SysUser
      code: string
      customer: number
      orderType: string
      productType: number
      recycleWay: number
      estimateNumber: number
      estimatePrice: number
      estimateWeight: number
      sendAddress: number
      receiveAddress: number
      receiptType: number
      receiptName: string
      receiptAccount: string
      identity: string
      belongBank: number
      createBy: SysUser
      createAt: string
      updateBy: SysUser
      updateAt: string
      qxtUserName: string
      qxtUserPhone: string
      employeeUser: {
        id: string
        name: string
        mobile: string
      }
      subStatus: string
      status: string
      confirmNumber: number
      confirmPrice: number
    }
    // 用户订单列表
    export interface FinanceOrderList {
      data: FinanceOrder[]
      count: number
    }
    // 用户订单详情
    export interface FinanceOrderDetail extends FinanceOrder {

      paymentOptions: {
        id: string
        sysUser: SysUser
        type: string
        realName: string
        realAccount: string
        identity: string
        belongBank: number
        isDefault: Boolean
        remark: string
        createBy: SysUser
        createAt: string
        source: SysUser
      }
    }
  }

}
